/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package negocio;

import java.io.Serializable;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Dvid
 */
@Entity
@Table(name = "sintoma_ficha")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "SintomaFicha.findAll", query = "SELECT s FROM SintomaFicha s"),
    @NamedQuery(name = "SintomaFicha.findBySintomaid", query = "SELECT s FROM SintomaFicha s WHERE s.sintomaFichaPK.sintomaid = :sintomaid"),
    @NamedQuery(name = "SintomaFicha.findByFichaid", query = "SELECT s FROM SintomaFicha s WHERE s.sintomaFichaPK.fichaid = :fichaid")})
public class SintomaFicha implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected SintomaFichaPK sintomaFichaPK;

    public SintomaFicha() {
    }

    public SintomaFicha(SintomaFichaPK sintomaFichaPK) {
        this.sintomaFichaPK = sintomaFichaPK;
    }

    public SintomaFicha(int sintomaid, int fichaid) {
        this.sintomaFichaPK = new SintomaFichaPK(sintomaid, fichaid);
    }

    public SintomaFichaPK getSintomaFichaPK() {
        return sintomaFichaPK;
    }

    public void setSintomaFichaPK(SintomaFichaPK sintomaFichaPK) {
        this.sintomaFichaPK = sintomaFichaPK;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (sintomaFichaPK != null ? sintomaFichaPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SintomaFicha)) {
            return false;
        }
        SintomaFicha other = (SintomaFicha) object;
        if ((this.sintomaFichaPK == null && other.sintomaFichaPK != null) || (this.sintomaFichaPK != null && !this.sintomaFichaPK.equals(other.sintomaFichaPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "negocio.SintomaFicha[ sintomaFichaPK=" + sintomaFichaPK + " ]";
    }
    
}
